﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fclient.Core
{
    class FlickerClient
    {
        public const string Secret = "96c9c530861690be";
        private FlickrNet.Flickr GetClient()
        {
            var client = new FlickrNet.Flickr("2ca69c75510aeb430e41d7de5aa76607", Secret);
            return client;
        }

        public void GetPhotos(string searchText,Action<FlickrNet.PhotoCollection> getPhotosCompleteAction)
        {
            GetClient().PhotosSearchAsync(new FlickrNet.PhotoSearchOptions()
            {
                Text = searchText,
                
            }, (result) => {
                getPhotosCompleteAction.Invoke(result.Result);
            });

            
        }


    }
}
